home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun 1984 Half 1
/
rerun-1984-01-06-side-b.d64
/
kingdom feb p76
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
3KB
|
122 lines
10 rem rule the kingdom by j. shaughnessy
12 poke53281,1:print"[144]";chr$(14)
14 p=100:ar=10:sp=0:rd=150:yh=3:gh=3000:ca=1000:yr=1:gs=2850
16 goto114
18 rem subroutines
20 print"[147] [211][212][193][212][197][160][207][198][160][212][200][197][160][210][197][193][204][205] [146]":print
22 printspc(13);" [208]eople:";p
24 printspc(13);" [193]cres :";ca
26 printspc(13);" [194]u. [211]tored:";gs
28 printspc(13);" [203]ingdom is at ";pw$
30 print:print" [146]":print:return
32 i=val(i$):i=int(abs(i)):return
34 rem delay loop
36 forx=1to4000:next:return
38 rem wait for key
40 printspc(11);"[200]it a key to proceed"
42 geta$:ifa$=""then42
44 return
46 print"[147]* [200]ail [199]reat [210]uler ! *[146]"
48 print"[201] beg to report that in the year";yr;"[146]of"
50 print"your reign:"
52 if sp=1then58
54 ifsp=0thenprint" [206]obody starved, and":goto60
56 print sp;"people starved,and";
57 goto60
58 print"[207]ne person starved,and ";
60 ifwk<1then68
62 ifwk=1thenprint"[207]ne ";:goto66
64 printwk;
66 print"died in battle"
68 ifar=1then72
70 print ar;"people came to the kingdom":goto76
72 ifsp<10andsp>1andwk<1thenprint" ";
74 print" one person came to the kingdom."
76 print"[215]e harvested";gh;
78 print"bushels at";yh;"bushels"
80 print"per acre."
82 print"[210]ats ruined";rd;"bu.";
84 print"leaving";gs
86 print"bushels in storage."
88 print"[212]he kingdom has";ca;
90 print"acres of land."
92 return
94 print"[207][200] [203]ing...think again!":gosub36:return
96 print"[212]he starving peasants raided the warehouses"
98 print"and destroyed 50% of the stored grain"
100 gs=int(gs/2):wr=0:gosub36:return
102 ifj>0thenreturn
104 p=p-int(p/2):print"[212]he plague killed half of the people."
106 print"[212]he population is now ";p;".":gosub36:return
108 ifsp<pthenreturn
110 print"[147][193]ll of your subjects are [196]ead...... [211]o are you!"
112 goto236
114 print:print"[147] [210][213][204][197] [212][200][197] [203][201][206][199][196][207][205] [146]"
116 print"[215]here you govern the ancient [203]ingdom of [194]abylon"
118 print"[212]he object is to keep the [203]ingdom growing"
120 print"[201]f you want to quit, sell all of your land."
122 gosub38
124 zz=rnd(ti):goto128
126 zz=rnd(1):ifzz<.3thenpw$="[215][193][210]":wf=1.5:goto130
128 wf=1:pw$="[208][197][193][195][197]"
130 gosub46:gosub38:gosub20
132 k=int(rnd(1)*12+16):print"[204]and is worth";k;
134 print"bushels per acre."
136 print" [194][146]uy,[211][146]ell,or [200][146]old [204]and"
138 gosub42
140 ifa$="b"ora$="s"ora$="h"then144
142 print"[157] [157][145]":goto138
144 ifa$="h"then172
146 print"[200]ow many acres"
148 input"*[157][157][157]";i$
150 ifi$="*"thenprint"[145][145]":goto148
152 gosub32:ifi=0then172
154 ifa$="s"then164
156 j=i*k:ifj<=gsthen160
158 gosub94:gosub20:goto136
160 gs=gs-j:ca=ca+i
162 gosub20:goto172
164 ifi=cathen234
166 ifi>cathengosub94:gosub20:goto146
168 ca=ca-i:gs=gs+k*i
170 gosub20
172 print:print"[196]istribute how many bushels for food"
174 input"*[157][157][157]";i$
176 ifi$="*"thenprint"[145][145][145]":goto174
178 gosub32
180 ifi<=gsthen184
182 gosub94:gosub20:goto172
184 ifi>(5*p)then190
186 ifi>gs/4then190
188 wr=1:rem warehs raid
190 gs=gs-i:sp=p-int(i/20):ar=0:gosub108:ifsp>=0then194
192 ar=-sp/2:sp=0
194 ifwr=1thengosub96
196 gosub20
198 print" [200]ow many acres shall we plant"
200 input"*[157][157][157]";i$
202 ifi$="*"thenprint"[145][145][145]":goto200
204 gosub32
206 ifi>cathen214
208 j=int(i/2):ifj>gsthen214
210 ifi>(10*p/wf)then214
212 goto218
214 gosub94:gosub20:goto198
216 rem calc changes for year
218 gs=gs-j:yh=1+int(rnd(1)*5):gh=yh*i:rd=int((gs+gh)*.07*rnd(1)):gs=gs-rd+gh
220 j=int(rnd(1)*25):ifwf=1.5thenwk=int(.3*rnd(1)*p):goto224
222 wk=0
224 ar=int(ar+(5-yh)*gs/600+1):ifar<=99then228
226 ar=99
228 ifar<0thenar=0
230 p=p+ar-sp-wk:yr=yr+1
232 gosub102:goto126
234 print"[147][217]ou have sold all of your land,the game is over"
236 print"[217]ou can go back to being yourself."
238 ca=ca+int(gs/k):b$=" increased"
240 if ca<1130thenb$=" decreased"
242 print"[196]uring your reign,you";b$;" the wealth"
244 print"of the kingdom by factor of";int((ca/1130)*1000)/1000;"in";
246 printyr;" years."
248 end